//package com.plian.system.service.fr.cluemanagement.impl;
//
//import com.plian.Tools.CollectionUtil;
//import com.plian.system.entity.fr.cluemanagement.ClueCollect;
//import com.plian.system.entity.fr.cluemanagement.ClueManagement;
//import com.plian.system.entity.hr.recruitment.RemovalManagement;
//import com.plian.system.mapper.fr.cluemanagement.ClueCollectMapper;
//import com.plian.system.mapper.hr.recruitment.RemovalManagementMapper;
//import com.plian.system.mybatis.base.BaseService;
//import com.plian.system.mybatis.base.BaseServiceImpl;
//import com.plian.system.service.fr.cluemanagement.IClueCollectService;
//import com.plian.system.service.hr.recruitment.INewRemovalManagementService;
//import com.plian.system.service.sys.file.FileService;
//import lombok.AllArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Service;
//
//import java.util.Optional;
//
//
//@Service
//@Slf4j
//@AllArgsConstructor
//public class ClueCollectServiceImpl extends BaseServiceImpl<ClueCollectMapper, ClueCollect> implements IClueCollectService {
//
//    private FileService fileService;
//
//
//    @Override
//    public boolean submit(ClueCollect clueCollect, ClueManagement clueManagement) {
//        boolean collectFlag = false;
//        if (!Optional.ofNullable(clueCollect.getId()).isPresent()) {
//            collectFlag = true;
//            clueCollect.setClueManagementId(String.valueOf(clueManagement.getId()));
//            clueCollect.setCode(clueManagement.getCode());
//        }
//        boolean result = super.saveOrUpdate(clueCollect);
//        // 上传附件
//        if (CollectionUtil.isNotEmpty(clueCollect.getDocList())) {
//            if (collectFlag) {
//                fileService.saveAll(String.valueOf(clueCollect.getId()), clueCollect.getDocList());
//            } else {
//                fileService.edit(String.valueOf(clueCollect.getId()), clueCollect.getDocList());
//            }
//        }
//        return result;
//    }
//}
